Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

137
Vistas
Source Maps not generated when using Webpack with "webpack serve"

After Webpack compiles the files of my web application into a bundle.js, I need source maps to debug when viewing my application in the browser. The problem is that I cannot seem to generate those Source Maps.

The command I use to launch is

npx webpack serve --config ./webpack.config.js --mode development

The application works fine afterwards except that I cannot debug errors in script.js file when viewing the application in Chrome or Firefox. Instead, the browser console just shows an error in script.js:formatted, which is a one-line file with all my code:

module.exports = " [here is all my code]"

I have the following webpack.config.js file. Note that I include the line devtool: "inline-source-map" (I have also tried devtool: "source-map")`.

//This is my webpack.config.js file
var glob = require("glob");

module.exports = {
  devtool: "inline-source-map",
  entry: {
    app: ['./js/script.js', './style/style.scss', ...glob.sync('./assets/*.png')],
  },
  mode: "development",
  output: {
    filename: './bundle.js',
    path: __dirname,
    sourceMapFilename: "script.js.map"
  },
  devServer: {
    static: './dist',
    hot: true,
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "script-loader"
        }
      },
      {
        test: /\.s[ac]ss$/i,
        use: [
          "style-loader",
          "css-loader",
          "sass-loader",
        ],
      },
      {
        test: /\.(png|svg|jpg|jpeg|gif)$/i,
        type: 'asset/resource',
      },
    ]
  },
};
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda